package com.imoney.payment.web.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.imoney.framework.hession.HessianInvoke;
import com.imoney.payment.authc.service.IAuthService;
import com.imoney.payment.member.service.IMemberMgrService;
import com.imoney.payment.member.service.IMemberQueryService;
import com.imoney.payment.web.service.IHessianServiceFactory;

/**
 * 类说明：HessianService工厂类<br>
 * 
 * <p>
 * 详细描述：<br>
 * 
 * </p>
 * 
 * <pre>
 * ——————————————————————————————————————————————————————————————————
 * |		修改人		|		修改时间			|		修改原因
 * ——————————————————————————————————————————————————————————————————
 * |	zengxx 曾宪新	|		2013-6-4		|	
 * ——————————————————————————————————————————————————————————————————
 * </pre>
 * 
 * @author zengxx 曾宪新(Xavier.zeng)
 * 
 *         CreateDate: 2013-6-4
 */
@Service(value = "hessianServiceFactory")
public final class HessianServiceFactory implements IHessianServiceFactory {

	@Resource
	private HessianInvoke payServiceInvoke;
	
	private IAuthService authService;
	
	private IMemberMgrService memberMgrService;
	
	private IMemberQueryService memberQueryService;

	/**
	 * Hessian服务工厂构造器
	 */
	public HessianServiceFactory() {
	}

	@Override
	public IAuthService getAuthService() {
		if (null == authService) {
			authService = (IAuthService) payServiceInvoke.getImpl(
					IAuthService.class, "authService");
		}
		return authService;
	}

	@Override
	public IMemberMgrService getMemberMgrService() {
		if (null == memberMgrService) {
			memberMgrService = (IMemberMgrService) payServiceInvoke.getImpl(
					IMemberMgrService.class, "memberMgrService");
		}
		return memberMgrService;
	}

	@Override
	public IMemberQueryService getMemberQueryService() {
		if (null == memberQueryService) {
			memberQueryService = (IMemberQueryService) payServiceInvoke.getImpl(
					IMemberQueryService.class, "memberQueryService");
		}
		return memberQueryService;
	}

}
